// Mark Czubin
#include "QtBoardSelector.h" 

QtBoardSelector::QtBoardSelector(QWidget *parent): QWidget(parent)
{
	ui.setupUi(this);
	
	QObject::connect(ui.buttonBox, SIGNAL(accepted()), this,  SLOT(OnConfirm()));
	QObject::connect(ui.buttonBox, SIGNAL(rejected()), this,  SLOT(OnCancel()));
	QObject::connect(ui.leftButton, SIGNAL(clicked()), ui.catalogusViewer, SLOT(showPreviousEvent()));
	QObject::connect(ui.rightButton, SIGNAL(clicked()), ui.catalogusViewer, SLOT(showNextEvent()));
}

QtBoardSelector::~QtBoardSelector()
{
	qDebug("Destructing boardselector");
}

void QtBoardSelector::GetMap()
{
	show();
}

void QtBoardSelector::paintEvent(QPaintEvent *)
{
	QPainter painter(this);

	//painter.setBrush(Qt::red);
	//painter.drawRect(rect());
}

void QtBoardSelector::OnConfirm()
{
	hide();
	NotifySelectedMap();
}

void QtBoardSelector::OnCancel()
{
	hide();
	NotifyCancelled();
}
